package week02

// 226. 翻转二叉树
// https://leetcode-cn.com/problems/invert-binary-tree/

func invertTree(root *TreeNode) *TreeNode {
	if root == nil {
		return nil
	}
	invertTree(root.Left)
	invertTree(root.Right)
	var temp = root.Left
	root.Left = root.Right
	root.Right = temp
	return root
}

type TreeNode struct {
	Val int
	Left *TreeNode
	Right *TreeNode
}
